Quicksort 15 - 122 : Principles of Imperative Computation ( Spring 2016 )
نویسنده
چکیده
In this lecture we consider two related algorithms for sorting that achieve a much better running time than the selection sort from an earlier lecture: mergesort and quicksort. We develop quicksort and its invariants in detail. As usual, contracts and loop invariants will bridge the gap between the abstract idea of the algorithm and its implementation. We will revisit many of the computational thinking, algorithm, and programming concepts from the previous lectures. We highlight the following important ones:
منابع مشابه
Quicksort 15 - 122 : Principles of Imperative Computation ( Summer 1 2015 )
In this lecture we consider two related algorithms for sorting that achieve a much better running time than the selection sort from last lecture: mergesort and quicksort. We developed quicksort and its invariants in detail. As usual, contracts and loop invariants will bridge the gap between the abstract idea of the algorithm and its implementation. We will revisit many of the computational thin...
متن کاملUnion - Find 15 - 122 : Principles of Imperative Computation ( Spring 2016 )
Kruskal’s algorithm for minimum weight spanning trees starts with a collection of single-node trees and adds edges until it has constructed a spanning tree. At each step, it must decide if adding the edge under consideration should create a cycle. If so, the edge would not be added to the spanning tree; if not, it will. In this lecture we will consider an efficient data structure for checking i...
متن کاملPrinciples of Imperative Computation ( Fall 2017 )
In this lecture we consider two related algorithms for sorting that achieve a much better running time than the selection sort from an earlier lecture: mergesort and quicksort. We develop quicksort and its invariants in detail. As usual, contracts and loop invariants will bridge the gap between the abstract idea of the algorithm and its implementation. We will revisit many of the computational ...
متن کاملLecture Notes on Dynamic Programming 15-122: Principles of Imperative Computation
In this lecture we introduce dynamic programming, which is a high-level computational thinking concept rather than a concrete algorithm. Perhaps a more descriptive title for the lecture would be sharing, because dynamic programming is about sharing computation. We have already seen earlier that sharing of space is also crucial: binary decision diagrams in which subtrees are shared are (in pract...
متن کاملLecture Notes on Union-Find 15-122: Principles of Imperative Computation
Kruskal’s algorithm for minimum weight spanning trees starts with a collection of single-node trees and adds edges until it has constructed a spanning tree. At each step, it must decide if adding the edge under consideration would create a cycle. If so, the edge would not be added to the spanning tree; if not, it will. In this lecture we will consider an efficient data structure for checking if...
متن کامل